<template>
      <div class="default-table-detail-container">
            <BaseTableInfo v-model="baseTableInfoModel" />
      </div>
</template>

<script lang="tsx" setup>

import SupplierInfoTypeApi from '../api/SupplierInfoTypeApi';
import SupplierInfoApi from '/@/api/webPath/SupplierInfoApi.ts';

const props = defineProps({
      modelValue: {

      }
})
const route = useRouter()
const supplierType = ref([])


const baseTableInfoModel = ref({
      columnCount: 2,
      autoFit: false,
      columnWidth: '300px',
      labelWidth: '200px',
      title: '基本信息',
      modelData: {},
      itemList: [
            {
                  title: '',
                  items: [   //渲染样式区域  通过key ===model 中的值
                        //                                   {
                        // label: "id",
                        //                               field: "id",
                        //                         },

                        {
                              label: "供应商编号",
                              field: "supplierNo",
                        },
                        {
                              label: "供应商类型",
                              field: "supplierTypeName",
                              render({ row }) {
                                    return <span>{row["supplierTypeName"]}</span>
                              },
                        },
                        {
                              label: "供应商名称",
                              field: "supplierName",
                        },
                        {
                              label: "供应商地址",
                              field: "supplierAdd",
                        },
                        {
                              label: "营业执照",
                              field: "creditUrl",
                              fieldFormat: 'img'

                        },
                        {
                              label: "供应商营业执照统一社会信用代码",
                              field: "creditCode",
                        },
                        {
                              label: "供应商营业执照发照日期",
                              field: "creditSignDate",
                              fieldFormat: "date",
                        },
                        {
                              label: "供应商许可证类型",
                              field: "licenseType",
                              // fieldFormat: 'img'
                        },

                        {
                              label: "供应商许可证",
                              field: "businessUrl",
                              fieldFormat: 'img'
                        },
                        {
                              label: "供应商许可证编码",
                              field: "produceCode",
                        },
                        {
                              label: "供应商许可证发证日期",
                              field: "produceSignDate",
                        },
                        {
                              label: "供应商许可证有效期",
                              field: "produceEffectiveDate",
                        },
                        {
                              label: "供应商许可证经营项目",
                              field: "produceTypeName",
                        },
                        {
                              label: "供应商产品类型",
                              field: "produceClass",

                        },
                        // {
                        //       label: "供应商类别",
                        //       field: "produceClass",
                        // },

                        {
                              label: "供应商类型编码",
                              field: "produceClassCode",

                        },
                        {
                              label: "供应商类别名称",
                              field: "produceClassName",

                        },

                        {
                              label: "供应商品种明细",
                              field: "produceClassDetail",

                        },
                        {
                              label: "创建时间",
                              field: "create_time",
                        },
                        {
                              label: "更新时间",
                              field: "update_time",
                        },
                  ]
            }
      ],
      buttons: [   //标题操作区域
            // {
            //   name: "更多",
            //  buttonClass: 'danger',
            // width: 100,
            // click: (any: object) => {   //暴露的方法钩子
            // $baseMessage("这里执行业务", 'success', 'vab-hey-message-success');
            //},
            //},


      ]
})

onMounted(async () => {
      //初始化数据model
      const { data } = await SupplierInfoApi.getDetail({
            supplierInfoId: props.modelValue.query.supplierInfoId   //从路由中获取参数
      })
      baseTableInfoModel.value.modelData = data;





})
</script>

<style lang="scss" scoped>
.default-table-detail-container {
      :deep() {
            .el-form--inline {
                  .el-form-item {
                        margin-right: 10px;
                  }
            }

            .el-descriptions__label {
                  min-width: 80px !important;
                  text-align: right;
            }
      }
}
</style>
